package day3;

import org.junit.Test;
import org.omg.PortableServer.ID_ASSIGNMENT_POLICY_ID;

public class MethodDemo {

	@Test
	public void test1() {
//		System.out.println("Hello");
//		System.out.println("Hello");
//		System.out.println("Hello");
		// 方法的调用：方法名+参数
		print();
		print();
		print();
	}
	
	public void print() {
		System.out.println("Hello");
		System.out.println("Hello");
		System.out.println("Hello");
	}
	
	@Test
	public void test2() {
		int num1 = 3;
		int num2 = 5;
		int max;
		if (num1 > num2) {
			max = num1;
		} else {
			max = num2;
		}
		System.out.println(max);
	}
	
	@Test
	public void test3() {
		int num1 = 3;
		int num2 = 5;
		
		int max = getMax(num1, num2);
		System.out.println(max);
		
		int num3 = 45;
		int num4 = 34;
		int max2 = getMax(num3,  num4);
		System.out.println(max2);
	}
	
	public int getMax(int num1, int num2) {
		int max;
		if (num1 > num2) {
			max = num1;
		} else {
			max = num2;
		}
		
		return max;
	}
	
}
